package com.xzit.homework;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringTest {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        //获取对象
        Student student = (Student) context.getBean("student");
        StudentService studentService = (StudentService) context.getBean("studentService");
        // 调用 StudentService 的保存方法，模拟保存操作
        studentService.saveStudent(student);
    }
}
